package com.x.erp.dao;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.x.erp.model.DetectionImage;
import com.x.framework.dao.BaseDao;

/**
 * 检测单图片信息
 */
@Repository
public class DetectionImageDao extends BaseDao {

	private final static String selectDetectionImageSql = "SELECT edi.* FROM ERP_DETECTION_IMAGE edi WHERE true ";
	/**
	 * 查询检测单图片信息
	 * @param detectionImage
	 * @return
	 * @throws Exception 
	 */
	public List<DetectionImage> selectDetectionImageList(DetectionImage detectionImage) throws Exception {
		StringBuilder sql = new StringBuilder(selectDetectionImageSql);
		List<Object> params = new ArrayList<Object>();
		if(this.isString(detectionImage.getDetectionId())){
			sql.append("AND edi.DETECTION_ID = ? ");
			params.add(detectionImage.getDetectionId());
		}
		return this.queryForList(sql.toString(), DetectionImage.class, params);
	}
}
